package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.heima.pojo.User;
import com.heima.pojo.dto.UserPageDTO;
import com.heima.pojo.vo.UserPageVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    Page<UserPageVO> page(UserPageDTO dto);

    int add(User user);

    @Select("select * from tb_user where id=#{userId}")
    User userById(Integer userId);

    int updatea(User user);

    @Delete("delete from tb_user where id=#{userId}")
    int del(Integer userId);
}
